package main.hsw.socialmedia.model.dao.rowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import main.hsw.socialmedia.model.entity.User;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public class UserRowMapper {

	
	private final Log logger = LogFactory.getLog(UserRowMapper.class);

	public User mapRow(ResultSet rs) throws SQLException {
		logger.debug("entering userRowMapper");

		User result = new User();
		result.setUserID(rs.getInt("userID"));
		result.setVorname(rs.getString("vorname"));
		result.setNachname(rs.getString("nachname"));
		result.setMail(rs.getString("mail"));
		result.setPassword(rs.getString("passwort"));
		result.setStrasse(rs.getString("strasse"));
		result.setHausnummer(rs.getString("hausnummer"));
		result.setPlz(rs.getString("plz"));
		result.setOrt(rs.getString("ort"));
		result.setGeschlecht(rs.getString("geschlecht"));
		return result;
	}

}
